//
//  DYAddBranchShopVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/18.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYAddBranchShopVC.h"
#import "DYAddBranchShopCell.h"

@interface DYAddBranchShopVC ()

@property (nonatomic,strong)NSArray *titleArray;
@property (nonatomic,strong)NSArray *palceholderArray;

@property (nonatomic,strong)UIButton *submitButton;

@end

@implementation DYAddBranchShopVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"新增分店";
    
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.titleArray=@[@"分店简称",@"店长姓名",@"店铺电话",@"店铺地址",@"详细地址",@"店长电话",@"登录密码"];
    self.palceholderArray=@[@"请输入分店简称",@"请输入店长姓名",@"请输入店铺电话",@"请选择分店店铺地址",@"请输入分店店铺详细地址",@"请输入店长电话，此电话为登录账号",@"请设置店长登录密码"];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.tableView.backgroundColor=WhiteColor;
    
    [self.tableView registerClass:[DYAddBranchShopCell class] forCellReuseIdentifier:@"DYAddBranchShopCell"];

    [self.tableView addSubview:self.submitButton];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 7;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return BILIHEIGHT(58);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
    
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.textField.placeholder=self.palceholderArray[indexPath.row];
    [cell.textField setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
    if (indexPath.row==3) {
        cell.arrowImageView.hidden=NO;
        cell.textField.enabled=NO;
    }else{
        cell.arrowImageView.hidden=YES;
        cell.textField.enabled=YES;
        if (indexPath.row==5) {
            [cell.textField setNumbersKeyboard];
        }
    }
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==3) {
        XHQHUDTEXT(@"选择地址");
    }
}
#pragma mark - 确认提交
-(void)submitButtonClick
{
    
}
-(UIButton *)submitButton
{
    if (!_submitButton) {
        _submitButton=[Utils createBtnWithType:UIButtonTypeCustom backgroundColor:[UIColor xhq_base] action:@selector(submitButtonClick) target:self title:@"确认提交" image:@"icon_login" font:17 textColor:WhiteColor];
        _submitButton.frame=CGRectMake(kScreenWidth-BILIWIDTH(142), BILIHEIGHT(58*7)+BILIHEIGHT(30), BILIWIDTH(132), BILIHEIGHT(38));
        [_submitButton placeImageTitlePosition: ZYButtonImagePositionRight space:BILIWIDTH(10)];
        [_submitButton xhq_cornerRadius:BILIHEIGHT(19)];
    }
    return _submitButton;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
